package com.tn.bo;

import java.util.Date;
import java.util.List;

import javax.persistence.Embedded;
import javax.persistence.Id;
import javax.persistence.Transient;

import com.googlecode.objectify.annotation.Entity;
@Entity
public class Company {
	private String companyId;
	private String companyName;
	private String companyTaxId;
	private String companySSN;
	private Date companyCreateDate;
	private Date companyLastUpdatedDate;
	@Id
	private String companyUniqueIdentifier;
	private String companyDoingBusinessAs;
	private String companyDomain;
	private String companyWebSite;
	private String companyABuyer;
	private String companyASupplier;
	
	private String addressLine1;
	private String addressLine2;
	private String city;
	private String state;
	private String zip;
	private String contact;
	private String phone;
	private String email;
	private String country;
	private String currency;
	private String URL;
	private String otherRegId;
	
	private String paymentScheduleType;
	private String paymentScheduleValue;
	
	

	public String getPaymentScheduleType() {
		return paymentScheduleType;
	}
	public void setPaymentScheduleType(String paymentScheduleType) {
		this.paymentScheduleType = paymentScheduleType;
	}
	public String getPaymentScheduleValue() {
		return paymentScheduleValue;
	}
	public void setPaymentScheduleValue(String paymentScheduleValue) {
		this.paymentScheduleValue = paymentScheduleValue;
	}
	public String getOtherRegId() {
		return otherRegId;
	}
	public void setOtherRegId(String otherRegId) {
		this.otherRegId = otherRegId;
	}
	public String getOtherRegvalue() {
		return otherRegvalue;
	}
	public void setOtherRegvalue(String otherRegvalue) {
		this.otherRegvalue = otherRegvalue;
	}
	private String otherRegvalue;
	
	@Transient
	private String assoStatus;
	
	
	
	
	public String getAssoStatus() {
		return assoStatus;
	}
	public void setAssoStatus(String assoStatus) {
		this.assoStatus = assoStatus;
	}
	public String getURL() {
		return URL;
	}
	public void setURL(String url) {
		URL = url;
	}
	private List<String> companyProfileAdmins;
	@Embedded
	private List<Address> locations;
	@Embedded
	private CommunicationPreference emailPreferences;
	@Embedded
	private CommunicationPreference faxPreferences;
	public CommunicationPreference getEmailPreferences() {
		return emailPreferences;
	}
	public void setEmailPreferences(CommunicationPreference emailPreferences) {
		this.emailPreferences = emailPreferences;
	}
	public CommunicationPreference getFaxPreferences() {
		return faxPreferences;
	}
	public void setFaxPreferences(CommunicationPreference faxPreferences) {
		this.faxPreferences = faxPreferences;
	}
	
	private List<String> paymentTerms;
	private List<String> supplierIds;
	
	
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	
	
	
	
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	private String fax;
	
	public String getContact() {
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	
	
	public List<String> getSupplierIds() {
		return supplierIds;
	}
	public void setSupplierIds(List<String> supplierIds) {
		this.supplierIds = supplierIds;
	}
	public List<String> getPaymentTerms() {
		return paymentTerms;
	}
	public void setPaymentTerms(List<String> paymentTerms) {
		this.paymentTerms = paymentTerms;
	}
	public List<String> getCompanyProfileAdmins() {
		return companyProfileAdmins;
	}
	public void setCompanyProfileAdmins(List<String> companyProfileAdmins) {
		this.companyProfileAdmins = companyProfileAdmins;
	}
	public List<Address> getLocations() {
		return locations;
	}
	public void setLocations(List<Address> locations) {
		this.locations = locations;
	}
	public String getCompanyId() {
		return companyId;
	}
	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}
	public String getCompanyName() {
		return companyName;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	public String getCompanyTaxId() {
		return companyTaxId;
	}
	public void setCompanyTaxId(String companyTaxId) {
		this.companyTaxId = companyTaxId;
	}
	public String getCompanySSN() {
		return companySSN;
	}
	public void setCompanySSN(String companySSN) {
		this.companySSN = companySSN;
	}
	public Date getCompanyCreateDate() {
		return companyCreateDate;
	}
	public void setCompanyCreateDate(Date companyCreateDate) {
		this.companyCreateDate = companyCreateDate;
	}
	public Date getCompanyLastUpdatedDate() {
		return companyLastUpdatedDate;
	}
	public void setCompanyLastUpdatedDate(Date companyLastUpdatedDate) {
		this.companyLastUpdatedDate = companyLastUpdatedDate;
	}
	public String getCompanyUniqueIdentifier() {
		return companyUniqueIdentifier;
	}
	public void setCompanyUniqueIdentifier(String companyUniqueIdentifier) {
		this.companyUniqueIdentifier = companyUniqueIdentifier;
	}
	public String getCompanyDoingBusinessAs() {
		return companyDoingBusinessAs;
	}
	public void setCompanyDoingBusinessAs(String companyDoingBusinessAs) {
		this.companyDoingBusinessAs = companyDoingBusinessAs;
	}
	public String getCompanyDomain() {
		return companyDomain;
	}
	public void setCompanyDomain(String companyDomain) {
		this.companyDomain = companyDomain;
	}
	public String getCompanyWebSite() {
		return companyWebSite;
	}
	public void setCompanyWebSite(String companyWebSite) {
		this.companyWebSite = companyWebSite;
	}
	public String getCompanyABuyer() {
		return companyABuyer;
	}
	public void setCompanyABuyer(String companyABuyer) {
		this.companyABuyer = companyABuyer;
	}
	public String getCompanyASupplier() {
		return companyASupplier;
	}
	public void setCompanyASupplier(String companyASupplier) {
		this.companyASupplier = companyASupplier;
	}
	public String getAddressLine1() {
		return addressLine1;
	}
	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}
	public String getAddressLine2() {
		return addressLine2;
	}
	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getZip() {
		return zip;
	}
	public void setZip(String zip) {
		this.zip = zip;
	}
	
	public boolean equals(Object other){
		return (other != null 
				&& other instanceof Company 
				&& this.getCompanyUniqueIdentifier() != null 
				&& this.getCompanyUniqueIdentifier().equals(((Company)other).getCompanyUniqueIdentifier()));
		
	}
	@Override
	public int hashCode() {
		
		return this.companyUniqueIdentifier.hashCode();
	}
	
	@Override
	public String toString() {
		return this.companyName;
	}

}
